from app import db

class User(db.Model):
    __tablename__ = "user"
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(1024))
    email = db.Column(db.String(1024))
    password = db.Column(db.String(1024))
    profiles = db.Column(db.Text)

class scratch_project(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    status = db.Column(db.String(32))
    title = db.Column(db.String(1024))
    cover = db.Column(db.Text)
    profiles = db.Column(db.Text)
    author_id = db.Column(db.Integer)
    love = db.Column(db.Integer)
    collection = db.Column(db.Integer)
    see = db.Column(db.Integer)


class love(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.String(1024))
    project_id = db.Column(db.Integer)
    #userid = db.Column(db.Integer,db.ForeignKey("user.id"))

class collection(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.String(1024))
    project_id = db.Column(db.Integer)
    #userid = db.Column(db.Integer,db.ForeignKey("user.id"))

class comment(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.String(1024))
    text = db.Column(db.Integer)
    place = db.Column(db.Integer)
    reply = db.Column(db.Integer)
    #userid = db.Column(db.Integer,db.ForeignKey("user.id"))

class message(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    Initiator_id = db.Column(db.Integer)
    position = db.Column(db.String)
    Recipient = db.Column(db.Integer)
    action = db.Column(db.Integer)
    #userid = db.Column(db.Integer,db.ForeignKey("user.id"))